<script>
var system = []
system.push({
    text: "电源板",
    tooltip: "产生产品运行所需电源",
    collapsed: true,
    children: [ //显示子系统
        { text: "28V线性电源电路", collapsed: true, tooltip: "产生28V线性电源", children: [] }, //系统下面就是原件，利用js动态添加
        { text: "12V线性电源电路", collapsed: true, tooltip: "产生12V线性电源", children: [] },
        { text: "氧传感器电源电路", collapsed: true, tooltip: "产生氧传感器电源", children: [] },
        { text: "15V DC/DC电源电路", collapsed: true, tooltip: "产生15V DC/DC电源", children: [] },
        { text: "无影响", collapsed: true, tooltip: "该分支下所有元件对系统均无影响", children: [{ text: "无影响", collapsed: true, items: [] }] },
    ],
    bad: [ //同理，电路对上一层的影响
        { text: "电源板12V线性电源故障", bad_result: "氧气监控器CAN通讯、工作模式选择、电磁阀驱动和报警驱动功能丧失", children: [] },
        { text: "电源板12V线性电源异常", bad_result: "氧气监控器CAN通讯、工作模式选择、电磁阀驱动和报警驱动功能下降", children: [] },
        { text: "电源板15V DC/DC电源故障", bad_result: "氧气监控器控制功能丧失", children: [] },
        { text: "电源板15V DC/DC电源异常", bad_result: "氧气监控器控制功能下降", children: [] },
        { text: "电源板28V线性电源故障", bad_result: "氧气监控器控制功能丧失", children: [] },
        { text: "电源板28V线性电源过压保护功能故障", bad_result: "氧气监控器过压保护功能丧失", children: [] },
        { text: "电源板28V线性电源过压保护功能异常", bad_result: "氧气监控器过压保护功能异常", children: [] },
        { text: "电源板28V线性电源异常", bad_result: "氧气监控器控制功能下降", children: [] },
        { text: "电源板氧传感器电源故障", bad_result: "氧气监控器氧分压检测功能丧失", children: [] },
        { text: "电源板氧传感器电源异常", bad_result: "氧气监控器氧分压检测功能下降", children: [] },
        { text: "自检告警和氧分压低告警功能失效", bad_result: "氧气监控器自检告警功能和氧分压低告警功能丧失", children: [] },
       // { text: "无影响", bad_result: "无影响", children: [] },
    ],
})

//利用const简历从下至上的迭代结构


const systemTree=[]
const a= { text: "28V线性电源电路", collapsed: true, tooltip: "产生28V线性电源", children: [] }
const b={ text: "12V线性电源电路", collapsed: true, tooltip: "产生12V线性电源", children: [] }
systemTree["children"]=[]
systemTree.children.push(a)
systemTree.children.push(b)

console.log(systemTree)


</script>